package com.woniu.petkonwledge.controller;

import com.woniu.common.entity.DogKonwledge;
import com.woniu.common.entity.OrderInfo;
import com.woniu.common.entity.ResponseResult;
import com.woniu.petkonwledge.service.DogKnowledgeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/dogknowledge")
public class DogKnowledgeController {
    @Autowired
    DogKnowledgeService dogKnowledgeService;

    @PostMapping("add")
    public ResponseResult<List<OrderInfo>> add(DogKonwledge dogKonwledge) {
       // System.out.println(dogKonwledge);


        return  dogKnowledgeService.adddogknowledge(dogKonwledge);
    }

    @GetMapping("getAll")
    public ResponseResult<List<OrderInfo>> get() {

        return  dogKnowledgeService.getdogknowledgeAll();
    }
}
